<template>
    <f7-page ptr @ptr:refresh="refresh" infinite :infinite-distance="50" :infinite-preloader="true" @infinite="infinite"
        class="common-page">
        <f7-navbar>
            <f7-nav-left>
                <f7-link back icon-material="chevron_left" force></f7-link>
            </f7-nav-left>
            <f7-nav-title>培训记录</f7-nav-title>
            <f7-nav-right> </f7-nav-right>
        </f7-navbar>
        <div class="content">
            <f7-list media-list class="search-list" v-if="query.data.length > 0">
                <li v-for="(item, index) in query.data" :key="index" @click="onDetail(item)" class="content-box">
                    <img src="../../../../../assets/img/qzjx/mobile/icon_train.png" alt="" width="44" height="44"
                        class="left-box" />
                    <div class="right-box">
                        <div class="title-box">
                            <h3>
                                {{ item.trainSubject }}
                            </h3>
                            <van-icon name="arrow" color="#CED6E0" />
                        </div>
                        <p>培训时间：{{ item.trainDate || "--" }}</p>
                    </div>
                </li>
            </f7-list>
            <v-empty v-else description="暂无数据" />
        </div>
    </f7-page>
</template>

<script>
import controller from "@/libs/framework/controller";
export default class instance extends controller {
    onInit () {
        this.setSearch("engineeId", this.$f7route.query.engineeId, "list")
    }
    onBeforeInit() {
        this.urls = {
            query: "/app/equipment/eqmMobileTrain/query",
        };
    }
    mixin() {
        return {
            methods: {
                onDetail(item) {
                    this.$f7router.navigate(`/business/qzjx/mobileEquipment/operator/trainCreate?pageAction=view&trainId=${item.trainId}`);
                }
            }
        };
    }
}
</script>

<style lang="less" scoped>
@import url("../../../../../assets/css/commonPage.less");
</style>
